import Service.ManagerService;
import mapper.ManagerMapper;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author Rain
 * @Description :
 * @date 2022/08/19 16:53
 */
public class TT {



    @Test
    public void test1() {
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        SqlSession sqlSession = (SqlSession) ac.getBean("sqlSession");
        ManagerMapper mapper = sqlSession.getMapper(ManagerMapper.class);
        int count = mapper.findCount();
        System.out.println(count);
    }

    @Test
    public void test2() {
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        ManagerMapper managerMapper = ac.getBean("managerMapper", ManagerMapper.class);
        System.out.println(managerMapper.findCount());
    }

    @Test
    public void test3() {
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        ManagerService ms = ac.getBean("managerService", ManagerService.class);

        System.out.println(ms.findCount());
    }


}
